<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>用户登录</title>
   <link rel="shortcut icon" href="__PUBLIC_CSS__/Public/images/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="__PUBLIC_CSS__/Public/Flat-UI/bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="__PUBLIC_CSS__/Public/Flat-UI/css/flat-ui.css">
  <link rel="stylesheet" href="__PUBLIC_CSS__/style.css">
  <script type="text/javascript" src="__PUBLIC_CSS__/Public/Flat-UI/js/jquery-1.10.2.min.js"></script>
  <script type="text/javascript" src="__PUBLIC_CSS__/Public/Flat-UI/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="__PUBLIC_CSS__/Public/jquery.form.js"></script>
  <script type="text/javascript">
    $(function(){
        $('#form1').ajaxForm({
            beforeSubmit:  checkForm,  // 此方法主要是提交前执行的方法，根据需要设置
            success:       complete,  // 这是提交后的方法
            dataType: 'json'
        });
        function checkForm(){
            //add ....
        }
        function complete(data){
            if (data.status==1){
                $('#result').html(data.info).show();
                location.href = '__APP__/'; 
            }else{
                $('#result').html(data.info).show();
            }
        }

    });

  </script>

</head>

<body id="body">

<div class="top">
<div class="container">
  <div class="wb-logo">
    <a href="__APP__/">学吒小助手</a>
  </div>
  <div class="wb-login">
  
  <a href="<?php echo $code_url?>"><img src="__PUBLIC_CSS__/Public/images/weibo-32.png" title="点击进入授权页面" alt="点击进入授权页面" border="0" /></a>
  </div> 
</div>
</div>

<block name="include"><include file="Login:header" /></block>
<div class="container">
<empty name="access_token"> <!--如果access_token不存在-->
  <empty name="id"><!--access_token不存在并且本地账号没有登录，显示登录表单-->
      <div id="login">
          <div id="result"></div>
          <div id="list"></div>
          <div class="login-form" style="height:230px;">
            <form id="form1" method="post" action="{:U(CONTROLLER_NAME.'/login')}">
              <div class="form-group">
                <input type="text" name="username" class="form-control login-field" value="" placeholder="Enter your name" id="title login-name">
                <label class="login-field-icon fui-user" for="login-name"></label>
              </div>

              <div class="form-group">
                <input type="password" name="password" class="form-control login-field" value="" placeholder="Password" id="login-pass">
                <label class="login-field-icon fui-lock" for="login-pass"></label>
              </div>
              <input type="submit" id="login-btn" class="btn btn-primary btn-lg btn-block" value="登陆">
             
            </form>
            
            
            <a class="login-link left"  href="{:U(CONTROLLER_NAME.'/register')}">注册</a>
            <a class="login-link right" href="{:U(CONTROLLER_NAME.'/getpass')}">找回密码</a>
          </div>
      </div>  
    <else/>  <!--access_token不存在,但是本地账号没有登录，显示绑定微博表单-->
      <div id="login">
          <div class="login-form">
              <a class="btn btn-primary btn-lg btn-block" href="<?php echo $code_url?>" > 该账号未绑定微博,请点击此处绑定微博 </a>
          </div>
      </div>
  </empty>

<else /><!--access_token存在-->
    <div id="login">
        <div class="login-form">
            <a class="btn btn-primary btn-lg btn-block" href="__APP__/" > 你已经使用微博账号登录，点击进入主页 </a>
        </div>
    </div> 
</empty>
 <block name="include"><include file="Login:footer" /></block>

</div>


</body>
</html>